﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.5
// Code is generated on: Thursday, October 16, 2008 1:31:25 PM
// Code is generated using templates: SD.TemplateBindings.SqlServerSpecific.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Data;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NL.ADA.ConfigService.DAL.DatabaseSpecific
{
	/// <summary>
	/// Singleton implementation of the PersistenceInfoProvider. This class is the singleton wrapper through which the actual instance is retrieved.
	/// </summary>
	/// <remarks>It uses a single instance of an internal class. The access isn't marked with locks as the PersistenceInfoProviderBase class is threadsafe.</remarks>
	internal sealed class PersistenceInfoProviderSingleton
	{
		#region Class Member Declarations
		private static readonly IPersistenceInfoProvider _providerInstance = new PersistenceInfoProviderCore();
		#endregion
		
		/// <summary>private ctor to prevent instances of this class.</summary>
		private PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Dummy static constructor to make sure threadsafe initialization is performed.</summary>
		static PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Gets the singleton instance of the PersistenceInfoProviderCore</summary>
		/// <returns>Instance of the PersistenceInfoProvider.</returns>
		public static IPersistenceInfoProvider GetInstance()
		{
			return _providerInstance;
		}
	}

	/// <summary>Actual implementation of the PersistenceInfoProvider. Used by singleton wrapper.</summary>
	internal class PersistenceInfoProviderCore : PersistenceInfoProviderBase
	{
		/// <summary>Initializes a new instance of the <see cref="PersistenceInfoProviderCore"/> class.</summary>
		internal PersistenceInfoProviderCore()
		{
			Init();
		}

		/// <summary>Method which initializes the internal datastores with the structure of hierarchical types.</summary>
		private void Init()
		{
			base.InitClass((5 + 0));
			InitApplicationEntityMappings();
			InitApplicationModeModifiedEntityMappings();
			InitConfigEntityMappings();
			InitConfigTypeEntityMappings();
			InitModeEntityMappings();

		}


		/// <summary>Inits ApplicationEntity's mappings</summary>
		private void InitApplicationEntityMappings()
		{
			base.AddElementMapping( "ApplicationEntity", "ConfigService", @"dbo", "Application", 5 );
			base.AddElementFieldMapping( "ApplicationEntity", "Id", "Id", false, (int)SqlDbType.Int, 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			base.AddElementFieldMapping( "ApplicationEntity", "Description", "Description", true, (int)SqlDbType.VarChar, 2147483647, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "ApplicationEntity", "Modified", "Modified", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 2 );
			base.AddElementFieldMapping( "ApplicationEntity", "Created", "Created", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 3 );
			base.AddElementFieldMapping( "ApplicationEntity", "AppCode", "AppCode", false, (int)SqlDbType.VarChar, 50, 0, 0, false, "", null, typeof(System.String), 4 );
		}
		/// <summary>Inits ApplicationModeModifiedEntity's mappings</summary>
		private void InitApplicationModeModifiedEntityMappings()
		{
			base.AddElementMapping( "ApplicationModeModifiedEntity", "ConfigService", @"dbo", "ApplicationModeModified", 3 );
			base.AddElementFieldMapping( "ApplicationModeModifiedEntity", "ApplicationId", "ApplicationId", false, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 0 );
			base.AddElementFieldMapping( "ApplicationModeModifiedEntity", "ModeId", "ModeId", false, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 1 );
			base.AddElementFieldMapping( "ApplicationModeModifiedEntity", "Modified", "Modified", false, (int)SqlDbType.DateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 2 );
		}
		/// <summary>Inits ConfigEntity's mappings</summary>
		private void InitConfigEntityMappings()
		{
			base.AddElementMapping( "ConfigEntity", "ConfigService", @"dbo", "Config", 9 );
			base.AddElementFieldMapping( "ConfigEntity", "Id", "Id", false, (int)SqlDbType.Int, 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			base.AddElementFieldMapping( "ConfigEntity", "Description", "Description", true, (int)SqlDbType.VarChar, 2147483647, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "ConfigEntity", "Key", "Key", false, (int)SqlDbType.VarChar, 50, 0, 0, false, "", null, typeof(System.String), 2 );
			base.AddElementFieldMapping( "ConfigEntity", "Value", "Value", true, (int)SqlDbType.VarChar, 50, 0, 0, false, "", null, typeof(System.String), 3 );
			base.AddElementFieldMapping( "ConfigEntity", "Modified", "Modified", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 4 );
			base.AddElementFieldMapping( "ConfigEntity", "Created", "Created", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 5 );
			base.AddElementFieldMapping( "ConfigEntity", "ModeId", "ModeId", false, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 6 );
			base.AddElementFieldMapping( "ConfigEntity", "ApplicationId", "ApplicationId", false, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 7 );
			base.AddElementFieldMapping( "ConfigEntity", "ConfigType", "ConfigType", false, (int)SqlDbType.Int, 0, 0, 10, false, "", null, typeof(System.Int32), 8 );
		}
		/// <summary>Inits ConfigTypeEntity's mappings</summary>
		private void InitConfigTypeEntityMappings()
		{
			base.AddElementMapping( "ConfigTypeEntity", "ConfigService", @"dbo", "ConfigType", 5 );
			base.AddElementFieldMapping( "ConfigTypeEntity", "Id", "Id", false, (int)SqlDbType.Int, 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			base.AddElementFieldMapping( "ConfigTypeEntity", "Description", "Description", true, (int)SqlDbType.VarChar, 2147483647, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "ConfigTypeEntity", "Modified", "Modified", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 2 );
			base.AddElementFieldMapping( "ConfigTypeEntity", "Created", "Created", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 3 );
			base.AddElementFieldMapping( "ConfigTypeEntity", "Name", "Name", true, (int)SqlDbType.VarChar, 50, 0, 0, false, "", null, typeof(System.String), 4 );
		}
		/// <summary>Inits ModeEntity's mappings</summary>
		private void InitModeEntityMappings()
		{
			base.AddElementMapping( "ModeEntity", "ConfigService", @"dbo", "Mode", 5 );
			base.AddElementFieldMapping( "ModeEntity", "Id", "Id", false, (int)SqlDbType.Int, 0, 0, 10, true, "SCOPE_IDENTITY()", null, typeof(System.Int32), 0 );
			base.AddElementFieldMapping( "ModeEntity", "Name", "Name", true, (int)SqlDbType.VarChar, 100, 0, 0, false, "", null, typeof(System.String), 1 );
			base.AddElementFieldMapping( "ModeEntity", "Description", "Description", true, (int)SqlDbType.VarChar, 2147483647, 0, 0, false, "", null, typeof(System.String), 2 );
			base.AddElementFieldMapping( "ModeEntity", "Modified", "Modified", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 3 );
			base.AddElementFieldMapping( "ModeEntity", "Created", "Created", true, (int)SqlDbType.SmallDateTime, 0, 0, 0, false, "", null, typeof(System.DateTime), 4 );
		}

	}
}













